<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<%@page import="com.dao.GameDao"%>
<%@page import="com.model.ClienteModel"%>
<%@page import="com.dao.ClienteDao"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<jsp:useBean id="game" class="com.model.GameModel" scope="request"/> 
<jsp:setProperty name="game" property="*"/>
<html>
	<head>
		<title>Tec Games - Cadastro</title>
		<link rel="stylesheet" type="text/css" href="../../resources/css/default.css" />
		<link rel="shortcut icon" href="<%=request.getContextPath()%>/favicon.ico" type="image/x-icon" />
	</head>
	<body>
		<div id="container">
			<jsp:include page="../../resources/header.jsp"/>
			<div id="content">
				<%	
					
					String error = "";
					String resultado = "";
					GameDao gameDao = new GameDao();
					game.setUrl("/resources/images/games/"+request.getParameter("select"));
					try{
						gameDao.salvar(game);	
						resultado = "Dados Gravados";
					}catch(Exception e){
						resultado = "Erro ao Gravar";
						error = e.toString();
					}
				%>
				<h2>
					<%=resultado%>
				</h2>
				
			</div>
		</div>
	</body>
</html>